package com.sgb.goods.event;

/**
 * 描述：用于商品模块发送、接收事件的实体对象
 * EventBus
 *
 * @author qiangHeNoooo
 * 时间：2021.10.28
 */
public final class GoodsEvent {
    /**
     * 发送、接收事件的标识
     */
    private int eventCode;
    /**
     * 发送、接收事件的数据
     */
    private Object messageData;
    /**
     * 发送、接收事件的其它数据
     */
    private Object messageTag;

    private GoodsEvent() {
    }

    public static GoodsEvent make() {
        return new GoodsEvent();
    }

    public static GoodsEvent make(int eventCode) {
        return new GoodsEvent().setEventCode(eventCode);
    }

    public static GoodsEvent make(int code, Object messageData) {
        return new GoodsEvent().setEventCode(code).setMessageData(messageData);
    }

    public static GoodsEvent make(int eventCode, Object messageData, Object messageTag) {
        return new GoodsEvent().setEventCode(eventCode).setMessageData(messageData).setMessageTag(messageTag);
    }

    public int getEventCode() {
        return eventCode;
    }

    public GoodsEvent setEventCode(int eventCode) {
        this.eventCode = eventCode;
        return this;
    }

    public Object getMessageData() {
        return messageData;
    }

    public GoodsEvent setMessageData(Object messageData) {
        this.messageData = messageData;
        return this;
    }

    public Object getMessageTag() {
        return messageTag;
    }

    public GoodsEvent setMessageTag(Object messageTag) {
        this.messageTag = messageTag;
        return this;
    }
}
